import request from '@/services/api'

export async function getChatInfo (id: string) {
  let ret = await request.get(`/chat/getMessage?targetUserId=${id}`)
  return ret?.data?.messageInfo?.reverse()??[]
}

export async function sendMessage (receiveUserId: string, content: string) {
  let ret = await request.post('/chat/sendMessage', {
    receiveUserId, content
  })
  return ret?.data?.id
}

